<me:UIVAART x:Class="WPFExcelReport.TPYVA06"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT" 
                    xmlns:VAK="clr-namespace:WPFExcelReport;assembly=TVAKOLL" 
                    xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
                     xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    Background="White"  
                    Loaded="Window_Loaded"
     >
    <me:UIVAART.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:TIMES100  x:Key="X100"/>
        <ucd:TIMES10  x:Key="X10"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PreisConverter  x:Key="PreisConverter"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIVAART.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0">
            <WrapPanel Visibility="{Binding IsEditor, Converter={StaticResource bv}}" >
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button  Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Grid.Column="1" >查询</TextBlock>
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button   Click="NewCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/New.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Grid.Column="1" >新建</TextBlock>
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button   Click="EditCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Grid.Column="1" >编辑</TextBlock>
                </Grid> 
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Click="DeleteCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/remove.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Grid.Column="1" >删除</TextBlock>
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button    Click="CopyCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/copy.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Grid.Column="1" >复制</TextBlock>
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button   Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                        </Button.Background>
                    </Button> 
                    <TextBlock Grid.Column="1" >确认</TextBlock>
                </Grid>
            </WrapPanel> 
        </StackPanel>
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
            </Grid.RowDefinitions>
            <StackPanel Visibility="{Binding IsEdit,Converter={StaticResource bv}}">
                <WrapPanel>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=季节:}}"></TextBlock>
                        <VAK:TSVA02 KOLL="{Binding KOLL,ElementName=TV}" 
                                      ORDERNUM="{Binding KOLL,ElementName=TV}" 
                                    />
                        <ex:TXT72 Grid.Column="1" MaxLength="5" CharacterCasing="Upper"   Text="{Binding VAAKOLL,Source={StaticResource vwMaster},Converter={StaticResource gb2312}}" Width="60" />
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=品种:}}"></TextBlock>
                        <ex:TXT72 Grid.Column="1"  MaxLength="24"  CharacterCasing="Upper" KeyUp="VAAART_KeyUp"   Text="{Binding VAAART,Source={StaticResource vwMaster},Converter={StaticResource gb2312}}"  Width="160" />
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=简述:}}"/>
                        <ex:TXT72 Grid.Column="1"  MaxLength="10"   CharacterCasing="Upper"   Text="{Binding VAAKURZBEZ,Source={StaticResource vwMaster},Converter={StaticResource gb2312}}"  Width="100" />
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=说明:}}"></TextBlock>
                        <ex:TXT72 Grid.Column="1"  MaxLength="30"  CharacterCasing="Upper"  Text="{Binding VAABEZ,Source={StaticResource vwMaster},Converter={StaticResource gb2312}}" Width="120" />
                    </Grid>
                </WrapPanel> 
                <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=克重:}}"></TextBlock>
                        <ex:TXT72 Grid.Column="1"   CharacterCasing="Upper"  Text="{Binding VAAGEWVON,Source={StaticResource vwMaster},Converter={StaticResource d100}}" Width="60" />
                        <SD:TSSD0181  Grid.Column="2"  KEY="{Binding VAAMEGEW,Source={StaticResource vwMaster}}" VALUE="{Binding VAAGEWGRP,Source={StaticResource vwMaster}}" />
                        <SD:TSSD0181  Grid.Column="3"  KEY="{Binding VAAMEGEH,Source={StaticResource vwMaster}}" VALUE="{Binding VAAMEGGRP,Source={StaticResource vwMaster}}" />
                    </Grid>  
            </StackPanel>
            <DataGrid  Grid.Row="1"  
                   MaxHeight="400"
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible" Grid.ColumnSpan="2" Margin="0,0,0,0"
                    >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=VAAKOLL,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=季节}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VAAART,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=品种}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VAAKURZBEZ,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=简述}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VAABEZ,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=描述}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VAABRTVON,Converter={StaticResource d100}}" Header="{Binding Source={Localization:Translate Word=幅宽}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VAAGEWVON,Converter={StaticResource d100}}" Header="{Binding Source={Localization:Translate Word=克重}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VAANEUBEN,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=更改}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VAAAENDDAT,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VAANEUBEN, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=创建}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VAANEUDAT,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
                </DataGrid.Columns>
            </DataGrid  >
        </Grid> 
    </Grid>
</me:UIVAART>
